import Vue from 'vue'
import Router from 'vue-router'

Vue.use(Router)

export default new Router({
    routes: [
        {
            path: "/",
            name: "Login",
            component: () => import('@/components/Login.vue')
        },
        {
            path: '/home',
            name: 'Index',
            component: () => import('@/components/Index.vue'),
            redirect: "/shouye",
            // redirect: "/shouye",
            children: [
                {
                    path: "/shouye",
                    name: "Shouye",
                    component: () => import('@/components/shouye/Index.vue')
                },
                {
                   path: "/user",
                   name: "UserIndex",
                   component: () => import('@/components/user/Index.vue')
                },
                {
                    path: "/role",
                    name: "sysRole",
                    component: () => import('@/components/role/Index.vue')
                },
                {
                    path: "/dept",
                    name: "Dept",
                    component: () => import('@/components/dept/Dept.vue')
                },
                {
                    path: "/class",
                    name: "Class",
                    component: () => import('@/components/class/Class.vue')
                },
                {
                    path: "/teachers",
                    name: "Teachers",
                    component: () => import('@/components/teachers/Teachers.vue')
                },
                {
                    path: "/shStudent",
                    name: "ShStudent",
                    component: () => import('@/components/shStudent/Index.vue')
                },
                {
                    path: "/worker",
                    name: "WorkerIndex",
                    component: () => import('@/components/worker/Index.vue')
                },
                {
                    path: "/schoolTeacher",
                    name: "SchoolTeacherIndex",
                    component: () => import('@/components/schoolTeacher/Index.vue')
                },
                {
                    path:"/danger",
                    name:"Danger",
                    component: () => import('@/components/danger/Danger.vue')
                }, 
                {
                    path: "/attendance",
                     name: "Attendance",
                      component: () => import('@/components/attendance/Index.vue')
                },
                {
                    path:"/guard",
                    name:"GuardIndex",
                    component: () => import('@/components/guard/Index.vue')        
                },
                {
                    path: "/teacherAttendance",
                     name: "TeacherAttendance",
                      component: () => import('@/components/teacherAttendance/Index.vue')
                }
            ]
        }
    ],
    mode: 'history'  //去掉# 
})